﻿@model thailandProject.ViewModel.ApartmentReservationModel

@{

    ViewBag.Title = "View Apartment Reservations";

}

<div id="Wrapper2">

   <div id="content_header">

       <div id="headerimage">

       </div>

       <div id="theheader">@ViewBag.Header</div>

   </div>

   <!-- Left Column begins here -->

   <aside id="sidebar-wrapper" style="border:none;>

       <nav class="sidebar" style="border:none;">

           <!-- CONTENT GOES HERE -->
           @{string url = "~/Reports/MoneyOwed/Index.aspx";
           <iframe src="@url" style="width:800px; height:800px; border:none;" />
           }
       </nav>
           

       <!-- Left column ends here -->

   </aside>

   <!-- Right column begins here -->

   <!--<article id="contents">

       

   </article>-->

   <!-- Right column ends here -->

</div>

<!-- Div wrapper2 ends here -->



<script>
    $(document).ready(function () {
        if ($("#showAll").next().attr('value') == 'false' || $("#showAll").next().attr('value') == 'False' || $("#showAll").next().attr('value') == '') {
            $("#showAll").attr('src', '../../images/unchecked.png');
        }
        else {
            $("#showAll").attr('src', '../../images/checked.png');
        }

        $("#showAll").click(function () {
            if ($(this).next().attr('value') == 'false')
            {

                $(this).attr('src', '../../images/checked.png');
                $(this).next().attr('value', 'true');
            }
            else
            {
                $(this).attr('src', '../../images/unchecked.png');
                $(this).next().attr('value', 'false');
            }
        });


        $("#sortlinks").children().children().click(function () {
            var sortType = $("#sort_type").attr('value');

            if ($(this).html() == "Property Name") {
                $("#sort_type").attr('value', 'propName');
            }
            else if ($(this).html() == "First Name") {
                $("#sort_type").attr('value', 'clientFirstName');
            }
            else if ($(this).html() == "Last Name") {
                $("#sort_type").attr('value', 'clientLastName');
            }
            else if ($(this).html() == "Start Date") {
                $("#sort_type").attr('value', 'startDate');
            }
            else if ($(this).html() == "End Date") {
                $("#sort_type").attr('value', 'endDate');
            }
            else if ($(this).html() == "Quoted Price") {
                $("#sort_type").attr('value', 'quotedPrice');
            }
            else if ($(this).html() == "Paid") {
                $("#sort_type").attr('value', 'paid');
            }


                if ($("#toggle_sort").attr('value') == 'True') {
                    $("#toggle_sort").attr('value', 'false');
                }
                else {
                    $("#toggle_sort").attr('value', 'true');
                }
            

            $("#searchForm").submit();

        });

        $("#printReport").click(function () {
            $("#searchForm").attr("action", "/Reporting/printPDF");
            $("#searchForm").submit();
            $("#searchForm").attr("action", "/Reporting/ViewApartmentReservations");
        });
    });
</script>